home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Resources.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  6.6 KB  |  399 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Resources.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__RESOURCES__') = 'UNDEFINED' THEN
  18. __RESOURCES__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  27.     include 'MixedMode.a'
  28.     ENDIF
  29.  
  30.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  31.     include 'Files.a'
  32.     ENDIF
  33. ;        include 'OSUtils.a'                                        ;
  34. ;            include 'Memory.a'                                        ;
  35.  
  36. resSysHeap                        EQU        64                    ;System or application heap?
  37. resPurgeable                    EQU        32                    ;Purgeable resource?
  38. resLocked                        EQU        16                    ;Load it in locked?
  39. resProtected                    EQU        8                    ;Protected?
  40. resPreload                        EQU        4                    ;Load in on OpenResFile?
  41. resChanged                        EQU        2                    ;Resource changed?
  42. mapReadOnly                        EQU        128                    ;Resource file read-only
  43. mapCompact                        EQU        64                    ;Compact resource file
  44. mapChanged                        EQU        32                    ;Write map out at update
  45. kResFileNotOpened                EQU        -1                    ;ref num return as error when opening a resource file
  46. kSystemResFile                    EQU        0                    ;this is the default ref num to the system file
  47.  
  48.     IF GENERATING68K THEN
  49.         _InitResources:    OPWORD    $A995
  50.     ELSE
  51.         IMPORT    InitResources
  52.     ENDIF
  53.  
  54.     IF GENERATING68K THEN
  55.         _RsrcZoneInit:    OPWORD    $A996
  56.     ELSE
  57.         IMPORT    RsrcZoneInit
  58.     ENDIF
  59.  
  60.     IF GENERATING68K THEN
  61.         _CloseResFile:    OPWORD    $A99A
  62.     ELSE
  63.         IMPORT    CloseResFile
  64.     ENDIF
  65.  
  66.     IF GENERATING68K THEN
  67.         _ResError:    OPWORD    $A9AF
  68.     ELSE
  69.         IMPORT    ResError
  70.     ENDIF
  71.  
  72.     IF GENERATING68K THEN
  73.         _CurResFile:    OPWORD    $A994
  74.     ELSE
  75.         IMPORT    CurResFile
  76.     ENDIF
  77.  
  78.     IF GENERATING68K THEN
  79.         _HomeResFile:    OPWORD    $A9A4
  80.     ELSE
  81.         IMPORT    HomeResFile
  82.     ENDIF
  83.  
  84.     IF GENERATING68K THEN
  85.         _CreateResFile:    OPWORD    $A9B1
  86.     ELSE
  87.         IMPORT    CreateResFile
  88.     ENDIF
  89.  
  90.     IF GENERATING68K THEN
  91.         _OpenResFile:    OPWORD    $A997
  92.     ELSE
  93.         IMPORT    OpenResFile
  94.     ENDIF
  95.  
  96.     IF GENERATING68K THEN
  97.         _UseResFile:    OPWORD    $A998
  98.     ELSE
  99.         IMPORT    UseResFile
  100.     ENDIF
  101.  
  102.     IF GENERATING68K THEN
  103.         _CountTypes:    OPWORD    $A99E
  104.     ELSE
  105.         IMPORT    CountTypes
  106.     ENDIF
  107.  
  108.     IF GENERATING68K THEN
  109.         _Count1Types:    OPWORD    $A81C
  110.     ELSE
  111.         IMPORT    Count1Types
  112.     ENDIF
  113.  
  114.     IF GENERATING68K THEN
  115.         _GetIndType:    OPWORD    $A99F
  116.     ELSE
  117.         IMPORT    GetIndType
  118.     ENDIF
  119.  
  120.     IF GENERATING68K THEN
  121.         _Get1IndType:    OPWORD    $A80F
  122.     ELSE
  123.         IMPORT    Get1IndType
  124.     ENDIF
  125.  
  126.     IF GENERATING68K THEN
  127.         _SetResLoad:    OPWORD    $A99B
  128.     ELSE
  129.         IMPORT    SetResLoad
  130.     ENDIF
  131.  
  132.     IF GENERATING68K THEN
  133.         _CountResources:    OPWORD    $A99C
  134.     ELSE
  135.         IMPORT    CountResources
  136.     ENDIF
  137.  
  138.     IF GENERATING68K THEN
  139.         _Count1Resources:    OPWORD    $A80D
  140.     ELSE
  141.         IMPORT    Count1Resources
  142.     ENDIF
  143.  
  144.     IF GENERATING68K THEN
  145.         _GetIndResource:    OPWORD    $A99D
  146.     ELSE
  147.         IMPORT    GetIndResource
  148.     ENDIF
  149.  
  150.     IF GENERATING68K THEN
  151.         _Get1IndResource:    OPWORD    $A80E
  152.     ELSE
  153.         IMPORT    Get1IndResource
  154.     ENDIF
  155.  
  156.     IF GENERATING68K THEN
  157.         _GetResource:    OPWORD    $A9A0
  158.     ELSE
  159.         IMPORT    GetResource
  160.     ENDIF
  161.  
  162.     IF GENERATING68K THEN
  163.         _Get1Resource:    OPWORD    $A81F
  164.     ELSE
  165.         IMPORT    Get1Resource
  166.     ENDIF
  167.  
  168.     IF GENERATING68K THEN
  169.         _GetNamedResource:    OPWORD    $A9A1
  170.     ELSE
  171.         IMPORT    GetNamedResource
  172.     ENDIF
  173.  
  174.     IF GENERATING68K THEN
  175.         _Get1NamedResource:    OPWORD    $A820
  176.     ELSE
  177.         IMPORT    Get1NamedResource
  178.     ENDIF
  179.  
  180.     IF GENERATING68K THEN
  181.         _LoadResource:    OPWORD    $A9A2
  182.     ELSE
  183.         IMPORT    LoadResource
  184.     ENDIF
  185.  
  186.     IF GENERATING68K THEN
  187.         _ReleaseResource:    OPWORD    $A9A3
  188.     ELSE
  189.         IMPORT    ReleaseResource
  190.     ENDIF
  191.  
  192.     IF GENERATING68K THEN
  193.         _DetachResource:    OPWORD    $A992
  194.     ELSE
  195.         IMPORT    DetachResource
  196.     ENDIF
  197.  
  198.     IF GENERATING68K THEN
  199.         _UniqueID:    OPWORD    $A9C1
  200.     ELSE
  201.         IMPORT    UniqueID
  202.     ENDIF
  203.  
  204.     IF GENERATING68K THEN
  205.         _Unique1ID:    OPWORD    $A810
  206.     ELSE
  207.         IMPORT    Unique1ID
  208.     ENDIF
  209.  
  210.     IF GENERATING68K THEN
  211.         _GetResAttrs:    OPWORD    $A9A6
  212.     ELSE
  213.         IMPORT    GetResAttrs
  214.     ENDIF
  215.  
  216.     IF GENERATING68K THEN
  217.         _GetResInfo:    OPWORD    $A9A8
  218.     ELSE
  219.         IMPORT    GetResInfo
  220.     ENDIF
  221.  
  222.     IF GENERATING68K THEN
  223.         _SetResInfo:    OPWORD    $A9A9
  224.     ELSE
  225.         IMPORT    SetResInfo
  226.     ENDIF
  227.  
  228.     IF GENERATING68K THEN
  229.         _AddResource:    OPWORD    $A9AB
  230.     ELSE
  231.         IMPORT    AddResource
  232.     ENDIF
  233.  
  234.     IF GENERATING68K THEN
  235.         _GetResourceSizeOnDisk:    OPWORD    $A9A5
  236.     ELSE
  237.         IMPORT    GetResourceSizeOnDisk
  238.     ENDIF
  239.  
  240.     IF GENERATING68K THEN
  241.         _GetMaxResourceSize:    OPWORD    $A821
  242.     ELSE
  243.         IMPORT    GetMaxResourceSize
  244.     ENDIF
  245.  
  246.     IF GENERATING68K THEN
  247.         _RsrcMapEntry:    OPWORD    $A9C5
  248.     ELSE
  249.         IMPORT    RsrcMapEntry
  250.     ENDIF
  251.  
  252.     IF GENERATING68K THEN
  253.         _SetResAttrs:    OPWORD    $A9A7
  254.     ELSE
  255.         IMPORT    SetResAttrs
  256.     ENDIF
  257.  
  258.     IF GENERATING68K THEN
  259.         _ChangedResource:    OPWORD    $A9AA
  260.     ELSE
  261.         IMPORT    ChangedResource
  262.     ENDIF
  263.  
  264.     IF GENERATING68K THEN
  265.         _RemoveResource:    OPWORD    $A9AD
  266.     ELSE
  267.         IMPORT    RemoveResource
  268.     ENDIF
  269.  
  270.     IF GENERATING68K THEN
  271.         _UpdateResFile:    OPWORD    $A999
  272.     ELSE
  273.         IMPORT    UpdateResFile
  274.     ENDIF
  275.  
  276.     IF GENERATING68K THEN
  277.         _WriteResource:    OPWORD    $A9B0
  278.     ELSE
  279.         IMPORT    WriteResource
  280.     ENDIF
  281.  
  282.     IF GENERATING68K THEN
  283.         _SetResPurge:    OPWORD    $A993
  284.     ELSE
  285.         IMPORT    SetResPurge
  286.     ENDIF
  287.  
  288.     IF GENERATING68K THEN
  289.         _GetResFileAttrs:    OPWORD    $A9F6
  290.     ELSE
  291.         IMPORT    GetResFileAttrs
  292.     ENDIF
  293.  
  294.     IF GENERATING68K THEN
  295.         _SetResFileAttrs:    OPWORD    $A9F7
  296.     ELSE
  297.         IMPORT    SetResFileAttrs
  298.     ENDIF
  299.  
  300.     IF GENERATING68K THEN
  301.         _OpenRFPerm:    OPWORD    $A9C4
  302.     ELSE
  303.         IMPORT    OpenRFPerm
  304.     ENDIF
  305.  
  306.     IF GENERATING68K THEN
  307.         _RGetResource:    OPWORD    $A80C
  308.     ELSE
  309.         IMPORT    RGetResource
  310.     ENDIF
  311.  
  312.     IF SystemSevenOrLater  THEN
  313.     IF GENERATING68K THEN
  314.         _HOpenResFile:    OPWORD    $A81A
  315.     ELSE
  316.         IMPORT    HOpenResFile
  317.     ENDIF
  318.  
  319.     ELSE
  320.     ENDIF
  321.     IF SystemSevenOrLater  THEN
  322.     IF GENERATING68K THEN
  323.         _HCreateResFile:    OPWORD    $A81B
  324.     ELSE
  325.         IMPORT    HCreateResFile
  326.     ENDIF
  327.  
  328.     ELSE
  329.     ENDIF
  330.     IF GENERATING68K THEN
  331.         Macro
  332.         _FSpOpenResFile
  333.             moveq    #13,d0
  334.             dc.w     $AA52
  335.         EndM
  336.     ELSE
  337.         IMPORT    FSpOpenResFile
  338.     ENDIF
  339.  
  340.     IF GENERATING68K THEN
  341.         Macro
  342.         _FSpCreateResFile
  343.             moveq    #14,d0
  344.             dc.w     $AA52
  345.         EndM
  346.     ELSE
  347.         IMPORT    FSpCreateResFile
  348.     ENDIF
  349.  
  350. ;  partial resource calls  
  351.     IF GENERATING68K THEN
  352.         Macro
  353.         _ReadPartialResource
  354.             moveq    #1,d0
  355.             dc.w     $A822
  356.         EndM
  357.     ELSE
  358.         IMPORT    ReadPartialResource
  359.     ENDIF
  360.  
  361.     IF GENERATING68K THEN
  362.         Macro
  363.         _WritePartialResource
  364.             moveq    #2,d0
  365.             dc.w     $A822
  366.         EndM
  367.     ELSE
  368.         IMPORT    WritePartialResource
  369.     ENDIF
  370.  
  371.     IF GENERATING68K THEN
  372.         Macro
  373.         _SetResourceSize
  374.             moveq    #3,d0
  375.             dc.w     $A822
  376.         EndM
  377.     ELSE
  378.         IMPORT    SetResourceSize
  379.     ENDIF
  380.  
  381.     IF GENERATING68K THEN
  382.         Macro
  383.         _GetNextFOND
  384.             moveq    #10,d0
  385.             dc.w     $A822
  386.         EndM
  387.     ELSE
  388.         IMPORT    GetNextFOND
  389.     ENDIF
  390.  
  391. ; Use TempInsertROMMap to force the ROM resource map to be
  392. ;   inserted into the chain in front of the system. Note that
  393. ;   this call is only temporary - the modified resource chain
  394. ;   is only used for the next call to the resource manager.
  395. ;   See IM IV 19 for more information. 
  396.     IF OLDROUTINENAMES  THEN
  397.     ENDIF
  398.     ENDIF ; __RESOURCES__
  399.